package bsplib.q3bsp;

import flash.utils.ByteArray;

class Q3Face
{
    public static inline var DIR_INDEX : Int = 13;
    
    public var texture : Int;
    public var effect : Int;
    public var type : Int;
    public var vertex : Int;
    public var nVertexes : Int;
    public var meshVert : Int;
    public var nMeshVerts : Int;
    public var lmIndex : Int;
    public var lmStart : Q3Vec2i;
    public var lmSize : Q3Vec2i;
    public var lmOrigin : Q3Vec3f;
    public var lmVec0 : Q3Vec2f;
    public var lmVec1 : Q3Vec2f;
    public var lmVec2 : Q3Vec2f;
    public var normal : Q3Vec3f;
    public var size : Q3Vec2i;
    
    public function new( data : ByteArray )
    {
        texture = data.readInt();
        effect = data.readInt();
        type = data.readInt();
        vertex = data.readInt();
        nVertexes = data.readInt();
        meshVert = data.readInt();
        nMeshVerts = data.readInt();
        lmIndex = data.readInt();
        lmStart = Q3Vec2i.FromByteArray(data);
        lmSize = Q3Vec2i.FromByteArray(data);
        lmOrigin = Q3Vec3f.FromByteArray(data);
        lmVec0 = Q3Vec2f.FromByteArray(data);
        lmVec1 = Q3Vec2f.FromByteArray(data);
        lmVec2 = Q3Vec2f.FromByteArray(data);
        normal = Q3Vec3f.FromByteArray(data);
        size = Q3Vec2i.FromByteArray(data);
    }

}